const TOKENKEY = 'heima-toutiao-token'

const saveToken = objToken => {
  localStorage.setItem(TOKENKEY, JSON.stringify(objToken))
}

const removeToken = () => {
  localStorage.removeItem(TOKENKEY)
}

const getToken = () => {
  return JSON.parse(localStorage.getItem(TOKENKEY))
}

export { saveToken, removeToken, getToken }
